package com.sdsy.controller;


/**
 * 会员钱包地址管理(VipWalletAddrMid)表控制层
 *
 * @author yxc
 * @since 2018-09-04 10:44:21
 */

import com.sdsy.domain.VipWalletAddrMidDO;
import com.sdsy.service.VipWalletAddrMidService;
import com.sdsy.util.MD5Utils;
import com.sdsy.util.SysUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

@Controller
public class VipWalletAddrMidController {
    private static Logger logger = LoggerFactory.getLogger(VipWalletAddrMidController.class);

    @Autowired
    private VipWalletAddrMidService vipWalletAddrMidService;


    @PostMapping("/vipWalletAddrMid/save")
    @ResponseBody
    public boolean save(VipWalletAddrMidDO entity) {


//        entity.setPrivateKey(MD5Utils.encrypt(entity.getPrivateKey()));
        entity.setCreateTime(new Date());
        entity.setWalletAddr(entity.getWalletAddr().toLowerCase());
        entity.setRemark("批量生成钱包地址");
        entity.setStatus(0l);
        return vipWalletAddrMidService.insert(entity);
    }

    @GetMapping({"/", ""})
    String welcome(Model model) {
        return "/index";
    }

}